<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>设备管理系统</title>

    <link rel="stylesheet" href="https://cdn.staticfile.org/twitter-bootstrap/4.3.1/css/bootstrap.min.css">
    <link rel="stylesheet" href="https://"
          integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO" crossorigin="anonymous">
</head>
<body>
<div class="container py-3" style="width: 40%; margin: 0 auto;">
    <h1 class="text-center mb-4">设备管理系统</h1>
    <hr>
    <h2 class="text-center mb-4">添加设备 </h2>
    <form action="#" th:action="@{/saveDevice}" th:object="${device}" method="POST">
        <div class="form-group" >
            <label for="name">名称：</label>
            <input type="text" id="name" name="name" class="form-control" th:field="*{name}">
        </div>
        <div class="form-group">
            <label for="type">类型：</label>
            <input type="text" id="type" name="type" class="form-control" th:field="*{type}">
        </div>
        <div class="form-group">
            <label for="status">状态：</label>
            <input type="text" id="status" name="status" class="form-control" th:field="*{status}">
        </div>
        <div class="form-group">
            <label for="model">设备型号：</label>
            <input type="text" id="model" name="equipment_model" class="form-control" th:field="*{equipmentModel}">
        </div>
        <div class="form-group">
            <label for="department">所属部门：</label>
            <select id="department" name="department.id" class="form-control" th:field="*{department.id}">
                <!--/*@thymesVar id="id" type=""*/-->
                <option th:each="department : ${departments}" th:value="${department.id}"
                        th:text="${department.name}"></option>
            </select>
        </div>
        <hr>
        <button type="submit" class="btn btn-primary"> 添加 </button>
    </form>

    <a th:href="@{/}" > 返回设备列表 </a>
</div>
</body>
</html>